<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Albums</title>
	</head>
	<body>
		<!-- user login/logout -->
		<s:if test="logged==true">
			<div align="rigth"><s:property value="loggedUser"/>&nbsp;<a href="logout">Logout</a></div>
		</s:if>
		<s:else>
			<div align="rigth"><a href="login">Login</a></div>
		</s:else>
		<!-- content -->
		<table border="1" cellpadding="2" cellspacing="0">
			<thead style="background-color:grey;">
				<tr>
					<th colspan="2">Recording</th>
					<th align="center">Format</th>
					<th align="center">Year</th>
					<th>Artist</th>
					<th>Title</th>
				</tr>
			</thead>
			<s:iterator value="albums">
				<tr>
					<td><a href="albumView?catalog=${catalog}">Балкантон <s:property value="catalog"/></a></td>
					<td><img src="image/${catalog}.jpg" height="50" width="50"/></td>
					<td><s:property value="format"/></td>
					<td><s:property value="released"/></td>
					<td>
						<s:iterator value="artists">
							<a href="artistView?name=${name}"><s:property value="name"/></a>&nbsp;
						</s:iterator>
					</td>
					<td><s:property value="title"/></td>
				</tr>
			</s:iterator>
		</table>
	</body>
</html>
